/** One agent as the Agents overview describes it. */ export interface IAgentRun { run_id: string; agent_kind: string; status: string; produced_count: number; cost_credits: number; detail: string; created_at: string | null; } /** The SEO medic's settings, as the agent normalises them. */ export interface ISeoMedicConfig { /** The checkup checks it writes on its own; the rest wait for approval. */ auto_apply: string[]; max_items_per_run: number; monthly_credit_cap: number; interval_hours: number; } export interface IAgentCard { kind: string; configured: boolean; enabled: boolean; config: ISeoMedicConfig & Record; next_run_at: string | null; last_run_at: string | null; pending_count: number; month_cost: number; last_run: IAgentRun | null; /** SEO medic only: whether a WordPress connector with a token exists. */ plugin_connected?: boolean; } export interface IAgentsOverview { pending_total: number; credits_balance: number; agents: IAgentCard[]; } /** What the medic would write for one check: pending until approved, applied once written. */ export interface IAgentProposal { proposal_id: string; agent_kind: string; run_id: string; item_ref: string; title: string; before: { check?: string; severity?: string; count?: number; items?: string[]; }; after: { check_id?: string; fix?: string; writes?: string[]; skipped?: string[]; verdict?: unknown; }; cost_credits: number; status: 'pending' | 'applied' | 'rejected' | string; created_at: string | null; decided_at: string | null; } export interface IAgentProposals { proposals: IAgentProposal[]; pending_total: number; } export interface IAgentConfigUpdate { enabled?: boolean; auto_apply?: string[]; max_items_per_run?: number; monthly_credit_cap?: number; interval_hours?: number; } export interface IAgentDecision { applied?: number; rejected?: number; failed_ids?: string[]; seo_run_ids?: string[]; error?: string; }