/** * Shared types for the Agent Ready page (agent-readiness-spec F1 + F4.5). * Mirrors the REST payload shapes produced by includes/class-agent-audit.php. */ export type FindingStatus = | 'pass' | 'warn' | 'fail' | 'handled_externally' | 'not_applicable'; export type Severity = 'blocking' | 'important' | 'nice'; export interface FindingFix { type: 'auto' | 'toggle' | 'manual' | 'link'; action: string | null; available: boolean; label: string; coming_soon?: boolean; /** One-click fix lives in the separate Pro add-on — show a promo, not a locked button. */ promo?: boolean; /* type === 'link': admin URL where the prerequisite is enabled. */ url?: string; } export interface Finding { id: string; domain: string; severity: Severity; label: string; description: string; status: FindingStatus; details: string; fix: FindingFix; } export interface DomainScore { id: string; label: string; weight: number; score: number; checks?: number; } export interface AuditCounts { pass: number; warn: number; fail: number; handled_externally: number; not_applicable: number; } export interface AuditSummary { generated_at: number; score: number; agent_ready: boolean; domains: DomainScore[]; counts: AuditCounts; } export interface AuditResult extends AuditSummary { has_result: boolean; locked: boolean; flag_checks: Record; findings: Finding[]; history: AuditSummary[]; } export interface WebmcpToolInfo { id: string; title: string; description: string; endpoint: { type: string; method: string; route: string; url: string }; } export interface IndexNowLogEntry { time: number; urls: number; status: number; error: string; } export interface SecurityHeaderSettings { nosniff: boolean; referrer: boolean; permissions: boolean; hsts: boolean; hsts_subdomains: boolean; csp_report: boolean; } export interface AgentReadySettings { toggles: Record; content_signal: { enabled: boolean; search: boolean; ai_input: boolean; ai_train: boolean; }; webmcp_add_to_cart: boolean; has_commerce_plan: boolean; woo_active: boolean; webmcp: { tools: WebmcpToolInfo[]; public_base: string; }; /* Phase F sub-options (FA-2/5/6/7/8). */ markdown_conneg: boolean; cache_plugin: string | null; restore_feed_links: boolean; canonical_fill: boolean; meta_description_fill: boolean; security_headers: SecurityHeaderSettings; indexnow: { handled_externally: boolean; owner: string | null; key_url: string | null; log: IndexNowLogEntry[]; }; } export interface FixResponse { finding: Finding; summary: AuditSummary | null; }