/** * The scoring orchestrator (M7): engine answers -> the AI Visibility Score. * * Pass 1 (deterministic) analyzes every answer; the judge pass (optional, ≤30% * of answers, cost-guarded) refines only the ambiguous ones; then per-engine * and composite scores, share of voice, and sources are aggregated into a * {@link ScoreReport}. All judge I/O is injected. */ import { CostGuard } from '../costs.js'; import { type BrandProfile, type EngineAnswer, type EngineScore, type JudgeClient, type MentionResult, type ScoreReport } from '../types.js'; export interface ScoreDeps { /** Judge for pass 2; omit to skip it (ambiguous results stay as pass 1). */ judge?: JudgeClient; guard?: CostGuard; } export interface ScoreOptions { /** Max share of answers judged in pass 2 (default {@link JUDGE_RATE_CAP}). */ judgeRateCap?: number; generatedAt?: string; /** * Prompts that named the brand (M5's "trust" intent). Their answers are kept * OUT of the visibility score - naming the brand guarantees a mention - and * summarized separately as {@link Reputation}. Empty/omitted = score every * answer as before. */ brandedPrompts?: string[]; } /** Score a run's engine answers against the brand profile. */ export declare function scoreAnswers(answers: EngineAnswer[], profile: BrandProfile, deps: ScoreDeps, opts?: ScoreOptions): Promise; /** * Group results by engine (in first-seen order) and score each. * * Exported because M12a scores products with the SAME per-engine aggregation * (including the retrieval accounting that decides how much of the grounded * premium an engine earned). A second copy of this in `core/shopping` would be * a second scoring methodology in everything but name. */ export declare function scorePerEngine(answers: EngineAnswer[], results: MentionResult[]): EngineScore[];